package com.celesea.auth.role.entity;

import com.celesea.framework.entity.BusEntity;
import com.celesea.framework.util.Const;
import com.celesea.framework.util.Version;

import javax.persistence.Column;
import javax.persistence.Table;

/**
 * @author JackYuan
 * @create 2017-10-25 14:20
 */
@Version
@Table(name = "role")
public class Role extends BusEntity {

    @Column(name = "`company`", columnDefinition = "所属公司", nullable = false, updatable = false)
    private String company;
    @Column(name = "`code`", columnDefinition = "编码")
    private String code;
    @Column(name = "`name`", columnDefinition = "角色名称", nullable = false)
    private String name;
    @Column(name = "`description`", columnDefinition = "描述")
    private String description;
    @Column(name = "`sort`", columnDefinition = "排序")
    private Integer sort;
    @Column(name = "`status_flag`", columnDefinition = "启停用状态：[0：停用，1：启用]", nullable = false)
    private Byte statusFlag;

    public Role() {
    }

    public Role disable() {
        this.statusFlag = Const.StatusFlag.DISABLE;
        return this;
    }

    public Role enable() {
        this.statusFlag = Const.StatusFlag.ENABLE;
        return this;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Byte getStatusFlag() {
        return statusFlag;
    }

    public void setStatusFlag(Byte statusFlag) {
        this.statusFlag = statusFlag;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company;
    }
}
